//
// RS Game Framework
// Copyright © 2010 Jedd Haberstro
// jhaberstro@gmail.com
// 
// $Id:
//

#ifndef RS_GRAPHICS_SHADERDESCRIPTION_HPP
#define RS_GRAPHICS_SHADERDESCRIPTION_HPP

#include "rs/graphics/ResourceDescription.hpp"

namespace rs
{
    namespace graphics
    {
        class ShaderDescription : public ResourceDescription
        {
            RS_DECLARE_POLYMORPHIC_REFLECTION();
            
        public:
            
            ShaderDescription(Char const* vsFile, Char const* fragFile, Char const** attributeNames, UInt32 attributesCount);

            ShaderDescription(Char const* vsFile, Char const* fragFile, Char const* geomShader, Char const** attributeNames, UInt32 attributesCount);
            
            Char const* GetVertexShaderFile() const;
            
            Char const* GetFragmentShaderFile() const;
            
            Char const* GetGeometryShaderFile() const;
            
            Char const** GetAttributeNames() const;
            
            UInt32 GetAttributeNamesCount() const;
            
        private:
            
            Char const* vsFile_;
            Char const* fragFile_;
            Char const* geomShader_;
            Char const** attributeNames_;
            UInt32 attributesCount_;
        };
        
                
        inline ShaderDescription::ShaderDescription(Char const* vsFile, Char const* fragFile, Char const** attributeNames, UInt32 attributesCount)
        : ResourceDescription(ResourceType::ShaderResource, ResourceAccess::None, ResourceUsage::Default),
          vsFile_(vsFile),
          fragFile_(fragFile),
          geomShader_(0),
          attributeNames_(attributeNames),
          attributesCount_(attributesCount) {
        }

        inline ShaderDescription::ShaderDescription(Char const* vsFile, Char const* fragFile, Char const* geomShader, Char const** attributeNames, UInt32 attributesCount)
        : ResourceDescription(ResourceType::ShaderResource, ResourceAccess::None, ResourceUsage::Default),
          vsFile_(vsFile),
          fragFile_(fragFile),
          geomShader_(geomShader),
          attributeNames_(attributeNames),
          attributesCount_(attributesCount) {
        }
        
        inline Char const* ShaderDescription::GetVertexShaderFile() const {
            return vsFile_;
        }
        
        inline Char const* ShaderDescription::GetFragmentShaderFile() const {
            return fragFile_;
        }
        
        inline Char const* ShaderDescription::GetGeometryShaderFile() const {
            return geomShader_;
        }
        
        inline Char const** ShaderDescription::GetAttributeNames() const {
            return attributeNames_;
        }
        
        inline UInt32 ShaderDescription::GetAttributeNamesCount() const {
            return attributesCount_;
        }
    }
}

#endif // RS_GRAPHICS_SHADERDESCRIPTION_HPP
